-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[FrameworkBundle] Add documentation about using a DSN as the session.handler_id
#15560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for that PR!
framework: | ||
session: | ||
# ... | ||
handler_id: 'file://%kernel.project_dir%/var/sessions' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about adding more examples as it was done in https://github.com/symfony/symfony-docs/pull/13227/files#diff-278a8e1908e2f0de9f2753d344b248e41eebde795a8e340569d2d0a3514cb29eR1290?
https://symfony.com/schema/dic/services/services-1.0.xsd | ||
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> | ||
<framework:config> | ||
<framework:session enabled="true" handler-id="file://%kernel.project_dir%/var/sessions"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<framework:session enabled="true" handler-id="file://%kernel.project_dir%/var/sessions"/> | |
<framework:session enabled="true" | |
handler-id="file://%kernel.project_dir%/var/sessions" | |
/> |
.. code-block:: php | ||
|
||
// config/packages/framework.php | ||
$container->loadFromExtension('framework', [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use the container configurator as done in other config blocks.
@@ -11,6 +11,64 @@ across different servers. | |||
Symfony can store sessions in all kinds of databases (relational, NoSQL and | |||
key-value) but recommends key-value databases like Redis to get best performance. | |||
|
|||
Define Session Storage by DSN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given my comment above this section should not be necessary.
], | ||
]); | ||
|
||
Supported DSN protocols are: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move this part in a .. note::
directive under the first example if this section were to be removed.
session.handler_id
Symfony 4.4 is not supported anymore, you may want to rebase on top of 5.4 branch. Maybe @alexandre-daubois or @alamirault want to take over? Thank you |
Definitely, I'll take care of this 🙂 |
… the `session.handler_id` (alexandre-daubois) This PR was merged into the 5.4 branch. Discussion ---------- [FrameworkBundle] Add documentation about using a DSN as the `session.handler_id` Rework of #15560 Commits ------- 264ebcc [FrameworkBundle] Add documentation about using a DSN as the `session.handler_id`
This one can be closed now that #18767 has been merged. |
The option to provide a DSN as the
framework.session.handler_id
was introduced in v4.4 but is currently not documented. It was previously mentioned, but the section was removed at some point.I've reused the config-example from #13227, and added it to both, the framework configuration reference and the page about using a database for session-storage (as the DSN can be used for file- or database-storage).